package model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

@XmlRootElement
public class BaiViet {
	private long idBaiViet;
	private ChuDe chuDe;
	private String tieuDe;
	private String tomTat;
	private String URLHinh;
	private Date ngayDang;
	private NguoiDung nguoiDang;
	private String noiDung;
	private int soLanXem;
	private String tuKhoaTimKiem;
	private Set<YKienBanDoc> dsYKienBanDoc = new HashSet<YKienBanDoc>();
	
	public BaiViet(){}
	
	public BaiViet(ChuDe chuDe, String tieuDe, String tomTat,
			String uRLHinh, Date ngayDang, NguoiDung nguoiDang, String noiDung,
			int soLanXem, String tuKhoaTimKiem) {
		this.chuDe = chuDe;
		this.tieuDe = tieuDe;
		this.tomTat = tomTat;
		URLHinh = uRLHinh;
		this.ngayDang = ngayDang;
		this.nguoiDang = nguoiDang;
		this.noiDung = noiDung;
		this.soLanXem = soLanXem;
		this.tuKhoaTimKiem = tuKhoaTimKiem;
	}
	
	public void addYkienBanDoc(YKienBanDoc YkienBanDoc){
		this.dsYKienBanDoc.add(YkienBanDoc);
	}

	public long getIdBaiViet() {
		return idBaiViet;
	}

	public void setIdBaiViet(long idBaiViet) {
		this.idBaiViet = idBaiViet;
	}

	public ChuDe getChuDe() {
		return chuDe;
	}

	public void setChuDe(ChuDe chuDe) {
		this.chuDe = chuDe;
	}

	public String getTieuDe() {
		return tieuDe;
	}

	public void setTieuDe(String tieuDe) {
		this.tieuDe = tieuDe;
	}

	public String getTomTat() {
		return tomTat;
	}

	public void setTomTat(String tomTat) {
		this.tomTat = tomTat;
	}

	public String getURLHinh() {
		return URLHinh;
	}

	public void setURLHinh(String uRLHinh) {
		URLHinh = uRLHinh;
	}

	public Date getNgayDang() {
		return ngayDang;
	}
	
	public void setNgayDang(Date ngayDang) {
		this.ngayDang = ngayDang;
	}

	public NguoiDung getNguoiDang() {
		return nguoiDang;
	}

	public void setNguoiDang(NguoiDung nguoiDang) {
		this.nguoiDang = nguoiDang;
	}

	public String getNoiDung() {
		return noiDung;
	}

	public void setNoiDung(String noiDung) {
		this.noiDung = noiDung;
	}

	public int getSoLanXem() {
		return soLanXem;
	}

	public void setSoLanXem(int soLanXem) {
		this.soLanXem = soLanXem;
	}

	public String getTuKhoaTimKiem() {
		return tuKhoaTimKiem;
	}

	public void setTuKhoaTimKiem(String tuKhoaTimKiem) {
		this.tuKhoaTimKiem = tuKhoaTimKiem;
	}

	@XmlTransient
	public Set<YKienBanDoc> getDsYKienBanDoc() {
		return dsYKienBanDoc;
	}

	public void setDsYKienBanDoc(Set<YKienBanDoc> dsYKienBanDoc) {
		this.dsYKienBanDoc = dsYKienBanDoc;
	}
}
